<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mold')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[mold]', ['0'=>'按重量', '1'=>'按件数'], $row['mold'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">配送区域及运费</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table region-table">
                <thead>
                <tr>
                    <th>配送区域</th><th>首件/首重(kg)</th><th>运费</th><th>续件/续重(kg)</th><th>续费</th>
                </tr>
                </thead>
                <tbody>
                {volist name="row.deliveryRules" id="vo"}
                <tr>
                    <td style="cursor: pointer;"><div class='area' data-ids='{$vo.area_ids}'>
                        <span>{$vo.area_names}</span>
                        <input class="area_ids" name='list[area_ids][]' style='display:none' value='{$vo.area_ids}' hidden='hidden' />
                        <input class="area_names" name='list[area_names][]' style='display:none' value='{$vo.area_names}' hidden='hidden' />
                    </div>
                    </td>
                    <td width='90px'><input class='form-control' name='list[first_num][]' value="{$vo.first_num}" /></td>
                    <td width='90px'><input class='form-control' name='list[first_price][]' value="{$vo.first_price}" /></td>
                    <td width='90px'><input class='form-control' name='list[rest_num][]' value="{$vo.rest_num}" /></td>
                    <td width='90px'><input class='form-control' name='list[rest_price][]' value="{$vo.rest_price}" /></td>
                    <td width='60px'><span class="btn btn-danger btn-del btn-sm">删除</span></td>
                </tr>
                {/volist}
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="3">
                        <a class="btn btn-success btn-add-region">+添加运费规则</a>
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
